<?php
//select 依据表，
function linkDB($hostname,$username,$password,$dbname)
{
	//仅负责打开数据库
	$conn = mysql_pconnect($hostname,$username,$password);
	
}

function select_data($conn,$table,$sql)
{//使用前需要先打开数据库，提供数据库的链接
	mysql_select_db($table);
	$rs = mysql_query($sql,$conn);
	
	return $rs;
}

function getphase($phid)
{
	switch ($phid)
	{
		case 1: $phase = "可研估算"; break;
		case 2: $phase = "可研审定"; break;
		case 3: $phase = "初设概算"; break;
		case 4: $phase = "初设审定"; break;
		case 5: $phase = "施工预算"; break;
		case 6: $phase = "竣工决算"; break;
		case 7: $phase = "完工结算"; break;
		default : $phase = 0;
	}
	return $phase;
}

function getype($ptid)
{
	switch ($ptid)
	{
		case 1: $ptype = "新建工程"; break;
		case 2: $ptype = "主变扩建"; break;
		case 3: $ptype = "间隔扩建"; break;
		case 4: $ptype = "保护改造"; break;
		case 5: $ptype = "架空线路"; break;
		case 6: $ptype = "电缆线路"; break;
		case 7: $ptype = "通信线路"; break;
		case 8: $ptype = "通信设备"; break;
		default : $ptype = "其他工程";
	}
	return $ptype;
}

?>